Auto Callback from Choice Selection

I'm creating a canvas where it will draw a particular shape based on what choice it is on from the DBE choice option (drop down selector).

So if I select square from the choice dropdown bar, it will draw a square.
If I switch and select a circle from the choice dropdown bar, it will draw a circle.

Is there a way to make it so that it gets the value in the choice DBE automatically each time i make a new selection? Or do I need another button and function to get the value of the choice DBE, so do I need to select the shape, then push a button to redraw the canvas. Thanks!
phan423 - Tue Jan 31 20:11:00 EST 2012

Re: Auto Callback from Choice Selection
llandale - Wed Feb 01 14:12:38 EST 2012

You an assign a callback directly to the choice DBE:

DBE dbeChoice
 
void clbkChoice(DBE dbeXX)
{ // React to changes in the choice DBE
  read the dbeChoice
  redraw or whatever
}
...
dbeChoice = choice(whatever)
set(dbeChoice, clbkChoice)


Such a callback MUST have exactly a single DBE input parameter; which is indeed set to the DBE of the choice so you can use it; but I always know which one so I routinely ignore it.

-Louie